package com.bldby.baselibrary.core.util;

import android.content.Context;

import com.bldby.baselibrary.core.view.CustomDialog;
import com.hjq.permissions.XXPermissions;
import com.lxj.xpopup.XPopup;

/**
 * package name: com.bldby.baselibrary.core.util
 * user: yangqinbo
 * date: 2020/7/10
 * time: 19:36
 * email: 694125155@qq.com
 */
public class PermissionsUtil {
    public static void toSetting(Context context, String content) {
        new XPopup.Builder(context)
                .asCustom(new CustomDialog(context)
                        .setCancelText("取消")
                        .setTitle("权限设置")
                        .setConfirmText("去设置")
                        .setContent(content)
                        .setListener(new CustomDialog.OnConfirmListener() {
                            @Override
                            public void onConfirm() {
                                XXPermissions.startPermissionActivity(context);
                               /* Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                                Uri uri = Uri.fromParts("package", context.getPackageName(), null);
                                intent.setData(uri);
                                context.startActivity(intent);*/
                            }
                        }, null))
                .show();

    }
}
